home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000119_icon-group-sender _Thu May 16 03:37:24 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Thu, 16 May 1996 08:41:13 MST
To: icon-group@cs.arizona.edu
Date: 16 May 1996 03:37:24 GMT
From: midtoad@cadvision.com (Stewart Midwinter)
Message-Id: <4ne7tk$17vo@elmo.cadvision.com>
Organization: Wings of Gaia
Sender: icon-group-request@cs.arizona.edu
Reply-To: midtoad@cadvision.com
Subject: 'Word wrap' utility
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
I'm only getting started in icon, but want to create a little utility.
Before I do though, I should ask whether I'm reinventing the wheel
and whether anyone else has already done this. I have written the
utility in turbo pascal, and am happy with its performance, but want
to test the claim that icon is better at string handling. So far,
some of the icon concepts are confusing to me.
Anyway, here's the concept of the strip utility:
Often we receive mail messages, or FAQs, or other items that, when
printed through a word processor or other program in proportional font
instead of courier font, look terrible, since the lines are too short
and of uneven length. The idea is to strip out all hard carriage
returns within paragraphs, so that the full line length is used.
Looks much nicer, but manually is not the way!
The problem centers around how to tell what carriage returns to strip
out:
- yes if the line is followed by another line of text
- no on lines of text followed by blank lines or lines containing only
spaces (we presume these are the last line of a paragraph)
- no on lines containing only spaces (we presume these lines are there
to create vertical white space)
- no on lines whose first non-space character is a number (we presume
these are table list items)
- no on lines whose first non-space character is in a user-definable
list of symbols (e.g.: / \<< >> etc.), typically these symbols would
be stored in a *.ini file (we presume that the user may have reason to
over-ride the program's logic by manually indicating certain lines
should be left as is (e.g. lines of a poem)
Some idea of how to approach the problem can be had by looking in the
icon library at yescr.icn and nocr.icn, which convert DOS line endings
to unix line endings (and vice versa).
Any suggestions on how to approach this, or has it been done already?
Cheers,
Stewart Midwinter
created with OS/2 Warp and Neologic News 4.5